package bbkj.org.cn.util;


import bbkj.org.cn.modle.DemoData;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DemoUtil {
	
	public static DemoData handleData(DemoData data,int min,int max){
		int d = data.getNum()==null?0:data.getNum();
		int num = getNum(min, max);
		log.info("区域min={},max={},值:{}",min,max,num);
		data.setNum(d*num);
		return data;
	}

	private static int getNum(int min, int max) {
		int num = (int) (Math.random()*max);
		if(num<min){
			return getNum(min, max);
		}
		return num;
	}
}
